package com.foreverwin.jzymes.production.picking.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.foreverwin.jzymes.production.picking.mapper.PickingBomMapper;
import com.foreverwin.jzymes.production.picking.domain.PickingBom;
import com.foreverwin.jzymes.production.picking.service.IPickingBomService;

/**
 * 领料清单 服务层实现
 *
 * @author levy
 * @date 2019-04-03
 */
@Service
public class PickingBomServiceImpl implements IPickingBomService
{
	@Autowired
	private PickingBomMapper pickingBomMapper;

	/**
	 * 查询领料清单信息
	 *
	 * @param handle 领料清单ID
	 * @return 领料清单信息
	 */
	@Override
	public PickingBom selectPickingBomById(String handle)
	{
		return pickingBomMapper.selectPickingBomById(handle);
	}

	/**
	 * 查询领料清单列表
	 *
	 * @param pickingBom 领料清单信息
	 * @return 领料清单集合
	 */
	@Override
	public List<PickingBom> selectPickingBomList(PickingBom pickingBom)
	{
		return pickingBomMapper.selectPickingBomList(pickingBom);
	}

	/**
	 * 新增领料清单
	 *
	 * @param pickingBom 领料清单信息
	 * @return 结果
	 */
	@Override
	public int insertPickingBom(PickingBom pickingBom)
	{
		return pickingBomMapper.insertPickingBom(pickingBom);
	}

	/**
	 * 修改领料清单
	 *
	 * @param pickingBom 领料清单信息
	 * @return 结果
	 */
	@Override
	public int updatePickingBom(PickingBom pickingBom)
	{
		return pickingBomMapper.updatePickingBom(pickingBom);
	}

	/**
	 * 删除领料清单对象
	 *
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deletePickingBomByIds(String ids)
	{
		return pickingBomMapper.deletePickingBomByIds(ids.split(","));
	}

	/**
	 * 查找领单号有关的物料
	 *
	 * @param bill 需要检索的领料单号
	 * @return 结果
	 */
	@Override
	public List<PickingBom> selectBomList(String bill) {
		return pickingBomMapper.selectBomList( bill );
	}
}
